-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: implement suspense for mdx content loading #13088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will decrease total bundle size by 107.02kB (-0.52%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
Files in
Files in
App Routes Affected:
|
AbhiPrasad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented React Suspense to handle MDX content loading, improving perceived performance.
This is a good change, but it's related to performance improvements, not fixing the issue we had
Added a loading indicator component to display while MDX content is being fetched.
This is assumed if you're adding Suspense
Refactored the page component to separate MDX content rendering into a separate component wrapped with Suspense.
Why refactor 😭 - I just want things fixed, don't spend time on improvements that make the PR harder tor review. If I wanted a refactor alongside the fix I woulda asked for it
Optimized remark and rehype plugins for better performance by removing unnecessary plugins and caching the getFileBySlug function.
Please don't determine "unnecessary plugins" for me - deleting all that code is recipe for disaster.
caching the getFileBySlug function is a great idea though, probably the only thing we should keep from all these changes. I assume the cache will reduce the calls to fetch data, so it should actually help reduce connection errors.
|
|
||
| export async function getFileBySlug(slug: string) { | ||
| // Cache the getFileBySlug function to avoid redundant processing | ||
| export const getFileBySlug = cache(async function(slug: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change
|
Extracted out the |
👋 Hi there! This PR was automatically generated by Autofix 🤖
This fix was triggered by Abhijeet Prasad
Fixes DOCS-8WS
getFileBySlugfunction.app/layout.tsxand updated styles.If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 12641.